<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes, TupleSections #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-11"></span><span>
</span><span id="line-12"></span><span class="hs-comment">-- | Typecheck arrow notation</span><span>
</span><span id="line-13"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Gen.Arrow</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcProc"><span class="hs-identifier">tcProc</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span>   </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html"><span class="hs-identifier">GHC.Tc.Gen.Expr</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier">tcCheckMonoExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcInferRho"><span class="hs-identifier">tcInferRho</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier">tcSyntaxOp</span></a></span><span>
</span><span id="line-18"></span><span>                                       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckId"><span class="hs-identifier">tcCheckId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier">tcCheckPolyExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html"><span class="hs-identifier">GHC.Tc.Gen.Match</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier">hsLPatType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcMType.html"><span class="hs-identifier">GHC.Tc.Utils.TcMType</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Bind.html"><span class="hs-identifier">GHC.Tc.Gen.Bind</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Pat.html"><span class="hs-identifier">GHC.Tc.Gen.Pat</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Unify.html"><span class="hs-identifier">GHC.Tc.Utils.Unify</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Origin.html"><span class="hs-identifier">GHC.Tc.Types.Origin</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier">mkLocalId</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Instantiate.html"><span class="hs-identifier">GHC.Tc.Utils.Instantiate</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.Prim.html"><span class="hs-identifier">GHC.Builtin.Types.Prim</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier">Arity</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-comment">{-
Note [Arrow overview]
~~~~~~~~~~~~~~~~~~~~~
Here's a summary of arrows and how they typecheck.  First, here's
a cut-down syntax:

  expr ::= ....
        |  proc pat cmd

  cmd ::= cmd exp                    -- Arrow application
       |  \pat -&gt; cmd                -- Arrow abstraction
       |  (| exp cmd1 ... cmdn |)    -- Arrow form, n&gt;=0
       |  ... -- If, case in the usual way

  cmd_type ::= carg_type --&gt; type

  carg_type ::= ()
             |  (type, carg_type)

Note that
 * The 'exp' in an arrow form can mention only
   &quot;arrow-local&quot; variables

 * An &quot;arrow-local&quot; variable is bound by an enclosing
   cmd binding form (eg arrow abstraction)

 * A cmd_type is here written with a funny arrow &quot;--&gt;&quot;,
   The bit on the left is a carg_type (command argument type)
   which itself is a nested tuple, finishing with ()

 * The arrow-tail operator (e1 -&lt; e2) means
       (| e1 &lt;&lt;&lt; arr snd |) e2


************************************************************************
*                                                                      *
                Proc
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcProc"><span class="hs-identifier hs-type">tcProc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>         </span><span class="hs-comment">-- proc pat -&gt; expr</span><span>
</span><span id="line-87"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#ExpRhoType"><span class="hs-identifier hs-type">ExpRhoType</span></a></span><span>                            </span><span class="hs-comment">-- Expected type of whole proc expression</span><span>
</span><span id="line-88"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#LPat"><span class="hs-identifier hs-type">LPat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcCoercion"><span class="hs-identifier hs-type">TcCoercion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span id="tcProc"><span class="annot"><span class="annottext">tcProc :: LPat GhcRn
-&gt; LHsCmdTop GhcRn
-&gt; ExpRhoType
-&gt; TcM (LPat GhcTc, LHsCmdTop GhcTc, TcCoercion)
</span><a href="GHC.Tc.Gen.Arrow.html#tcProc"><span class="hs-identifier hs-var hs-var">tcProc</span></a></span></span><span> </span><span id="local-6989586621681157461"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681157461"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681157460"><span class="annot"><span class="annottext">LHsCmdTop GhcRn
</span><a href="#local-6989586621681157460"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span id="local-6989586621681157459"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157459"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span>
</span><span id="line-91"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
-&gt; TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#newArrowScope"><span class="hs-identifier hs-var">newArrowScope</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
 -&gt; TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion))
-&gt; TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
-&gt; TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157457"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157457"><span class="hs-identifier hs-var">exp_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#expTypeToType"><span class="hs-identifier hs-var">expTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157459"><span class="hs-identifier hs-var">exp_ty</span></a></span><span>  </span><span class="hs-comment">-- no higher-rank stuff with arrows</span><span>
</span><span id="line-93"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157455"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157455"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157454"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157454"><span class="hs-identifier hs-var">exp_ty1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157453"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157453"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM (TcCoercion, (TcType, TcType))
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedAppTy"><span class="hs-identifier hs-var">matchExpectedAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157457"><span class="hs-identifier hs-var">exp_ty</span></a></span><span>
</span><span id="line-94"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157451"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157451"><span class="hs-identifier hs-var">co1</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157450"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157450"><span class="hs-identifier hs-var">arr_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157449"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157449"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM (TcCoercion, (TcType, TcType))
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedAppTy"><span class="hs-identifier hs-var">matchExpectedAppTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157454"><span class="hs-identifier hs-var">exp_ty1</span></a></span><span>
</span><span id="line-95"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157448"><span class="annot"><span class="annottext">cmd_env :: CmdEnv
</span><a href="#local-6989586621681157448"><span class="hs-identifier hs-var hs-var">cmd_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdEnv :: TcType -&gt; CmdEnv
</span><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cmd_arr :: TcType
</span><a href="GHC.Tc.Gen.Arrow.html#cmd_arr"><span class="hs-identifier hs-var">cmd_arr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157450"><span class="hs-identifier hs-var">arr_ty</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157445"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681157445"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157444"><span class="annot"><span class="annottext">LHsCmdTop GhcTc
</span><a href="#local-6989586621681157444"><span class="hs-identifier hs-var">cmd'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled TcType
-&gt; TcM (LHsCmdTop GhcTc)
-&gt; TcM (LPat GhcTc, LHsCmdTop GhcTc)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled TcType -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#ProcExpr"><span class="hs-identifier hs-var">ProcExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681157461"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Scaled TcType
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157449"><span class="hs-identifier hs-var">arg_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (LHsCmdTop GhcTc) -&gt; TcM (LPat GhcTc, LHsCmdTop GhcTc))
-&gt; TcM (LHsCmdTop GhcTc) -&gt; TcM (LPat GhcTc, LHsCmdTop GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-97"></span><span>                          </span><span class="annot"><span class="annottext">CmdEnv
-&gt; LHsCmdTop GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmdTop GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdTop"><span class="hs-identifier hs-var">tcCmdTop</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157448"><span class="hs-identifier hs-var">cmd_env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmdTop GhcRn
</span><a href="#local-6989586621681157460"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157453"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157438"><span class="annot"><span class="annottext">res_co :: TcCoercion
</span><a href="#local-6989586621681157438"><span class="hs-identifier hs-var hs-var">res_co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcCoercion -&gt; TcCoercion -&gt; TcCoercion
</span><a href="GHC.Tc.Types.Evidence.html#mkTcTransCo"><span class="hs-identifier hs-var">mkTcTransCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157455"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-99"></span><span>                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcCoercion -&gt; TcCoercion -&gt; TcCoercion
</span><a href="GHC.Tc.Types.Evidence.html#mkTcAppCo"><span class="hs-identifier hs-var">mkTcAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157451"><span class="hs-identifier hs-var">co1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcCoercion
</span><a href="GHC.Tc.Types.Evidence.html#mkTcNomReflCo"><span class="hs-identifier hs-var">mkTcNomReflCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157453"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
-&gt; TcM (Located (Pat GhcTc), LHsCmdTop GhcTc, TcCoercion)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681157445"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsCmdTop GhcTc
</span><a href="#local-6989586621681157444"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157438"><span class="hs-identifier hs-var">res_co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Commands
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="hs-comment">-- See Note [Arrow overview]</span><span>
</span><span id="line-111"></span><span class="hs-keyword">type</span><span> </span><span id="CmdType"><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdType"><span class="hs-identifier hs-var">CmdType</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdArgType"><span class="hs-identifier hs-type">CmdArgType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcTauType"><span class="hs-identifier hs-type">TcTauType</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- cmd_type</span><span>
</span><span id="line-112"></span><span class="hs-keyword">type</span><span> </span><span id="CmdArgType"><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdArgType"><span class="hs-identifier hs-var">CmdArgType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcTauType"><span class="hs-identifier hs-type">TcTauType</span></a></span><span>                  </span><span class="hs-comment">-- carg_type, a nested tuple</span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span class="hs-keyword">data</span><span> </span><span id="CmdEnv"><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-var">CmdEnv</span></a></span></span><span>
</span><span id="line-115"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="CmdEnv"><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-var">CmdEnv</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-116"></span><span>        </span><span id="cmd_arr"><span class="annot"><span class="annottext">CmdEnv -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#cmd_arr"><span class="hs-identifier hs-var hs-var">cmd_arr</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-comment">-- arrow type constructor, of kind *-&gt;*-&gt;*</span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-118"></span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#mkCmdArrTy"><span class="hs-identifier hs-type">mkCmdArrTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcTauType"><span class="hs-identifier hs-type">TcTauType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcTauType"><span class="hs-identifier hs-type">TcTauType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcTauType"><span class="hs-identifier hs-type">TcTauType</span></a></span><span>
</span><span id="line-120"></span><span id="mkCmdArrTy"><span class="annot"><span class="annottext">mkCmdArrTy :: CmdEnv -&gt; TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkCmdArrTy"><span class="hs-identifier hs-var hs-var">mkCmdArrTy</span></a></span></span><span> </span><span id="local-6989586621681157430"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157430"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157429"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157429"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621681157428"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157428"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.Type.html#mkAppTys"><span class="hs-identifier hs-var">mkAppTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdEnv -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#cmd_arr"><span class="hs-identifier hs-var hs-var">cmd_arr</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157430"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157429"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157428"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="hs-comment">---------------------------------------</span><span>
</span><span id="line-123"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcCmdTop"><span class="hs-identifier hs-type">tcCmdTop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span>
</span><span id="line-124"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-125"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdType"><span class="hs-identifier hs-type">CmdType</span></a></span><span>
</span><span id="line-126"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span id="tcCmdTop"><span class="annot"><span class="annottext">tcCmdTop :: CmdEnv
-&gt; LHsCmdTop GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmdTop GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdTop"><span class="hs-identifier hs-var hs-var">tcCmdTop</span></a></span></span><span> </span><span id="local-6989586621681157426"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157426"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157424"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157424"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdTop"><span class="hs-identifier hs-type">HsCmdTop</span></a></span><span> </span><span id="local-6989586621681157422"><span class="annot"><span class="annottext">XCmdTop GhcRn
</span><a href="#local-6989586621681157422"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681157421"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157421"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157420"><span class="annot"><span class="annottext">cmd_ty :: (TcType, TcType)
</span><a href="#local-6989586621681157420"><span class="hs-identifier hs-var">cmd_ty</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681157419"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157419"><span class="hs-identifier hs-var">cmd_stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157418"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157418"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (LHsCmdTop GhcTc) -&gt; TcM (LHsCmdTop GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157424"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsCmdTop GhcTc) -&gt; TcM (LHsCmdTop GhcTc))
-&gt; TcM (LHsCmdTop GhcTc) -&gt; TcM (LHsCmdTop GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157416"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157416"><span class="hs-identifier hs-var">cmd'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157426"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157421"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157420"><span class="hs-identifier hs-var">cmd_ty</span></a></span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157414"><span class="annot"><span class="annottext">[(Name, HsExpr GhcTc)]
</span><a href="#local-6989586621681157414"><span class="hs-identifier hs-var">names'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Name, HsExpr GhcRn)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Name, HsExpr GhcTc))
-&gt; [(Name, HsExpr GhcRn)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [(Name, HsExpr GhcTc)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CtOrigin
-&gt; TcType
-&gt; (Name, HsExpr GhcRn)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Name, HsExpr GhcTc)
</span><a href="GHC.Tc.Utils.Instantiate.html#tcSyntaxName"><span class="hs-identifier hs-var">tcSyntaxName</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#ProcOrigin"><span class="hs-identifier hs-var">ProcOrigin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdEnv -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#cmd_arr"><span class="hs-identifier hs-var hs-var">cmd_arr</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157426"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Name, HsExpr GhcRn)]
XCmdTop GhcRn
</span><a href="#local-6989586621681157422"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-132"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsCmdTop GhcTc -&gt; TcM (LHsCmdTop GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsCmdTop GhcTc -&gt; LHsCmdTop GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157424"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(HsCmdTop GhcTc -&gt; LHsCmdTop GhcTc)
-&gt; HsCmdTop GhcTc -&gt; LHsCmdTop GhcTc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdTop GhcTc -&gt; LHsCmd GhcTc -&gt; HsCmdTop GhcTc
forall p. XCmdTop p -&gt; LHsCmd p -&gt; HsCmdTop p
</span><a href="GHC.Hs.Expr.html#HsCmdTop"><span class="hs-identifier hs-var">HsCmdTop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; [(Name, HsExpr GhcTc)] -&gt; CmdTopTc
</span><a href="GHC.Hs.Expr.html#CmdTopTc"><span class="hs-identifier hs-var">CmdTopTc</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157419"><span class="hs-identifier hs-var">cmd_stk</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157418"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[(Name, HsExpr GhcTc)]
</span><a href="#local-6989586621681157414"><span class="hs-identifier hs-var">names'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157416"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span class="hs-comment">----------------------------------------</span><span>
</span><span id="line-135"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-type">tcCmd</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdType"><span class="hs-identifier hs-type">CmdType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>        </span><span class="hs-comment">-- The main recursive function</span><span>
</span><span id="line-137"></span><span id="tcCmd"><span class="annot"><span class="annottext">tcCmd :: CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var hs-var">tcCmd</span></a></span></span><span> </span><span id="local-6989586621681157409"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157409"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157408"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157408"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681157407"><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157407"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157406"><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157406"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-138"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (LHsCmd GhcTc) -&gt; TcM (LHsCmd GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157408"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (LHsCmd GhcTc) -&gt; TcM (LHsCmd GhcTc))
-&gt; TcM (LHsCmd GhcTc) -&gt; TcM (LHsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-139"></span><span>        </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157405"><span class="annot"><span class="annottext">HsCmd GhcTc
</span><a href="#local-6989586621681157405"><span class="hs-identifier hs-var">cmd'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; HsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (HsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157409"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157407"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157406"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-140"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc -&gt; TcM (LHsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsCmd GhcTc -&gt; LHsCmd GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157408"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc
</span><a href="#local-6989586621681157405"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-type">tc_cmd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmd"><span class="hs-identifier hs-type">HsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdType"><span class="hs-identifier hs-type">CmdType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmd"><span class="hs-identifier hs-type">HsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span id="tc_cmd"><span class="annot"><span class="annottext">tc_cmd :: CmdEnv -&gt; HsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (HsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var hs-var">tc_cmd</span></a></span></span><span> </span><span id="local-6989586621681157403"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157403"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdPar"><span class="hs-identifier hs-type">HsCmdPar</span></a></span><span> </span><span id="local-6989586621681157401"><span class="annot"><span class="annottext">XCmdPar GhcRn
</span><a href="#local-6989586621681157401"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157400"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157400"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157399"><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157399"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-144"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157398"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157398"><span class="hs-identifier hs-var">cmd'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157403"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157400"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157399"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdPar GhcTc -&gt; LHsCmd GhcTc -&gt; HsCmd GhcTc
forall id. XCmdPar id -&gt; LHsCmd id -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdPar"><span class="hs-identifier hs-var">HsCmdPar</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdPar GhcRn
XCmdPar GhcTc
</span><a href="#local-6989586621681157401"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157398"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157397"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157397"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLet"><span class="hs-identifier hs-type">HsCmdLet</span></a></span><span> </span><span id="local-6989586621681157395"><span class="annot"><span class="annottext">XCmdLet GhcRn
</span><a href="#local-6989586621681157395"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157394"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157394"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681157393"><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681157393"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157392"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157392"><span class="hs-identifier hs-var">body_loc</span></a></span></span><span> </span><span id="local-6989586621681157391"><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157391"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157390"><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157390"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-148"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157389"><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681157389"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157388"><span class="annot"><span class="annottext">HsCmd GhcTc
</span><a href="#local-6989586621681157388"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsLocalBinds GhcTc, HsCmd GhcTc)
forall thing.
HsLocalBinds GhcRn -&gt; TcM thing -&gt; TcM (HsLocalBinds GhcTc, thing)
</span><a href="GHC.Tc.Gen.Bind.html#tcLocalBinds"><span class="hs-identifier hs-var">tcLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681157393"><span class="hs-identifier hs-var">binds</span></a></span><span>         </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsLocalBinds GhcTc, HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsLocalBinds GhcTc, HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-149"></span><span>                             </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157392"><span class="hs-identifier hs-var">body_loc</span></a></span><span>        </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-150"></span><span>                             </span><span class="annot"><span class="annottext">CmdEnv -&gt; HsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (HsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157397"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157391"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157390"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-151"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdLet GhcTc -&gt; LHsLocalBinds GhcTc -&gt; LHsCmd GhcTc -&gt; HsCmd GhcTc
forall id. XCmdLet id -&gt; LHsLocalBinds id -&gt; LHsCmd id -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdLet"><span class="hs-identifier hs-var">HsCmdLet</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLet GhcRn
XCmdLet GhcTc
</span><a href="#local-6989586621681157395"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsLocalBinds GhcTc -&gt; LHsLocalBinds GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157394"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681157389"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsCmd GhcTc -&gt; LHsCmd GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157392"><span class="hs-identifier hs-var">body_loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc
</span><a href="#local-6989586621681157388"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157386"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157386"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157385"><span class="annot"><span class="annottext">in_cmd :: HsCmd GhcRn
</span><a href="#local-6989586621681157385"><span class="hs-identifier hs-var">in_cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdCase"><span class="hs-identifier hs-type">HsCmdCase</span></a></span><span> </span><span id="local-6989586621681157383"><span class="annot"><span class="annottext">XCmdCase GhcRn
</span><a href="#local-6989586621681157383"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157382"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157382"><span class="hs-identifier hs-var">scrut</span></a></span></span><span> </span><span id="local-6989586621681157381"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157381"><span class="hs-identifier hs-var">matches</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157380"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157380"><span class="hs-identifier hs-var">stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157379"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157379"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var">cmdCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157385"><span class="hs-identifier hs-var">in_cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-155"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681157376"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157376"><span class="hs-identifier hs-var">scrut'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157375"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157375"><span class="hs-identifier hs-var">scrut_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcM (LHsExpr GhcTc, TcType)
</span><a href="GHC.Tc.Gen.Expr.html#tcInferRho"><span class="hs-identifier hs-var">tcInferRho</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157382"><span class="hs-identifier hs-var">scrut</span></a></span><span>
</span><span id="line-156"></span><span>      </span><span id="local-6989586621681157374"><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157374"><span class="hs-identifier hs-var">matches'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv
-&gt; TcType
-&gt; MatchGroup GhcRn (LHsCmd GhcRn)
-&gt; (TcType, TcType)
-&gt; TcM (MatchGroup GhcTc (LHsCmd GhcTc))
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdMatches"><span class="hs-identifier hs-var">tcCmdMatches</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157386"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157375"><span class="hs-identifier hs-var">scrut_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157381"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157380"><span class="hs-identifier hs-var">stk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157379"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>      </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdCase GhcTc
-&gt; LHsExpr GhcTc -&gt; MatchGroup GhcTc (LHsCmd GhcTc) -&gt; HsCmd GhcTc
forall id.
XCmdCase id -&gt; LHsExpr id -&gt; MatchGroup id (LHsCmd id) -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdCase"><span class="hs-identifier hs-var">HsCmdCase</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdCase GhcRn
XCmdCase GhcTc
</span><a href="#local-6989586621681157383"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157376"><span class="hs-identifier hs-var">scrut'</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157374"><span class="hs-identifier hs-var">matches'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157372"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157372"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157371"><span class="annot"><span class="annottext">in_cmd :: HsCmd GhcRn
</span><a href="#local-6989586621681157371"><span class="hs-identifier hs-var">in_cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLamCase"><span class="hs-identifier hs-type">HsCmdLamCase</span></a></span><span> </span><span id="local-6989586621681157369"><span class="annot"><span class="annottext">XCmdLamCase GhcRn
</span><a href="#local-6989586621681157369"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157368"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157368"><span class="hs-identifier hs-var">matches</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157367"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157367"><span class="hs-identifier hs-var">stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157366"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157366"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var">cmdCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157371"><span class="hs-identifier hs-var">in_cmd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-161"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681157365"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157365"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681157364"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157364"><span class="hs-identifier hs-var">scrut_ty</span></a></span></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157363"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157363"><span class="hs-identifier hs-var">stk'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcType -&gt; TcM (TcCoercion, [TcType], TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-var">matchExpectedCmdArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157367"><span class="hs-identifier hs-var">stk</span></a></span><span>
</span><span id="line-162"></span><span>      </span><span id="local-6989586621681157361"><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157361"><span class="hs-identifier hs-var">matches'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv
-&gt; TcType
-&gt; MatchGroup GhcRn (LHsCmd GhcRn)
-&gt; (TcType, TcType)
-&gt; TcM (MatchGroup GhcTc (LHsCmd GhcTc))
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdMatches"><span class="hs-identifier hs-var">tcCmdMatches</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157372"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157364"><span class="hs-identifier hs-var">scrut_ty</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157368"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157363"><span class="hs-identifier hs-var">stk'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157366"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>      </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; HsCmd GhcTc -&gt; HsCmd GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsCmdWrap"><span class="hs-identifier hs-var">mkHsCmdWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcCoercion -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpCastN"><span class="hs-identifier hs-var">mkWpCastN</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157365"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdLamCase GhcTc -&gt; MatchGroup GhcTc (LHsCmd GhcTc) -&gt; HsCmd GhcTc
forall id. XCmdLamCase id -&gt; MatchGroup id (LHsCmd id) -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdLamCase"><span class="hs-identifier hs-var">HsCmdLamCase</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLamCase GhcRn
XCmdLamCase GhcTc
</span><a href="#local-6989586621681157369"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157361"><span class="hs-identifier hs-var">matches'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157358"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157358"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdIf"><span class="hs-identifier hs-type">HsCmdIf</span></a></span><span> </span><span id="local-6989586621681157356"><span class="annot"><span class="annottext">XCmdIf GhcRn
</span><a href="#local-6989586621681157356"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="GHC.Hs.Expr.html#NoSyntaxExprRn"><span class="hs-identifier hs-var">NoSyntaxExprRn</span></a></span><span> </span><span id="local-6989586621681157354"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157354"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621681157353"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157353"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621681157352"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157352"><span class="hs-identifier hs-var">b2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157351"><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157351"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>    </span><span class="hs-comment">-- Ordinary 'if'</span><span>
</span><span id="line-166"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157350"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157350"><span class="hs-identifier hs-var">pred'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157354"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#boolTy"><span class="hs-identifier hs-var">boolTy</span></a></span><span>
</span><span id="line-167"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157348"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157348"><span class="hs-identifier hs-var">b1'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157358"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157353"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157351"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-168"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157347"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157347"><span class="hs-identifier hs-var">b2'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157358"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157352"><span class="hs-identifier hs-var">b2</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157351"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-169"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdIf GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; LHsExpr GhcTc
-&gt; LHsCmd GhcTc
-&gt; LHsCmd GhcTc
-&gt; HsCmd GhcTc
forall id.
XCmdIf id
-&gt; SyntaxExpr id
-&gt; LHsExpr id
-&gt; LHsCmd id
-&gt; LHsCmd id
-&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdIf"><span class="hs-identifier hs-var">HsCmdIf</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdIf GhcRn
XCmdIf GhcTc
</span><a href="#local-6989586621681157356"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="GHC.Hs.Expr.html#NoSyntaxExprTc"><span class="hs-identifier hs-var">NoSyntaxExprTc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157350"><span class="hs-identifier hs-var">pred'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157348"><span class="hs-identifier hs-var">b1'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157347"><span class="hs-identifier hs-var">b2'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157345"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157345"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdIf"><span class="hs-identifier hs-type">HsCmdIf</span></a></span><span> </span><span id="local-6989586621681157344"><span class="annot"><span class="annottext">XCmdIf GhcRn
</span><a href="#local-6989586621681157344"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157343"><span class="annot"><span class="annottext">fun :: SyntaxExpr GhcRn
</span><a href="#local-6989586621681157343"><span class="hs-identifier hs-var">fun</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#SyntaxExprRn"><span class="hs-identifier hs-type">SyntaxExprRn</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157341"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157341"><span class="hs-identifier hs-var">pred</span></a></span></span><span> </span><span id="local-6989586621681157340"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157340"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621681157339"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157339"><span class="hs-identifier hs-var">b2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157338"><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157338"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-comment">-- Rebindable syntax for if</span><span>
</span><span id="line-173"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157337"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157337"><span class="hs-identifier hs-var">pred_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newOpenFlexiTyVarTy"><span class="hs-identifier hs-var">newOpenFlexiTyVarTy</span></a></span><span>
</span><span id="line-174"></span><span>        </span><span class="hs-comment">-- For arrows, need ifThenElse :: forall r. T -&gt; r -&gt; r -&gt; r</span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-comment">-- because we're going to apply it to the environment, not</span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-comment">-- the return value.</span><span>
</span><span id="line-177"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TCvSubst
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681157335"><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157335"><span class="hs-identifier hs-var">r_tv</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcTyVar] -&gt; TcM (TCvSubst, [TcTyVar])
</span><a href="GHC.Tc.Utils.Instantiate.html#tcInstSkolTyVars"><span class="hs-identifier hs-var">tcInstSkolTyVars</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcTyVar
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157332"><span class="annot"><span class="annottext">r_ty :: TcType
</span><a href="#local-6989586621681157332"><span class="hs-identifier hs-var hs-var">r_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcTyVar -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyVarTy"><span class="hs-identifier hs-var">mkTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157335"><span class="hs-identifier hs-var">r_tv</span></a></span><span>
</span><span id="line-179"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; TcM ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157335"><span class="hs-identifier hs-var">r_tv</span></a></span><span> </span><span class="annot"><span class="annottext">TcTyVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157337"><span class="hs-identifier hs-var">pred_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Predicate type of `ifThenElse' depends on result type&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157325"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157325"><span class="hs-identifier hs-var">pred'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157324"><span class="annot"><span class="annottext">SyntaxExprTc
</span><a href="#local-6989586621681157324"><span class="hs-identifier hs-var">fun'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-182"></span><span>            </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([TcType] -&gt; [TcType] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a.
CtOrigin
-&gt; SyntaxExprRn
-&gt; [SyntaxOpType]
-&gt; ExpRhoType
-&gt; ([TcType] -&gt; [TcType] -&gt; TcM a)
-&gt; TcM (a, SyntaxExprTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcSyntaxOp"><span class="hs-identifier hs-var">tcSyntaxOp</span></a></span><span> </span><span class="annot"><span class="annottext">CtOrigin
</span><a href="GHC.Tc.Types.Origin.html#IfOrigin"><span class="hs-identifier hs-var">IfOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
SyntaxExprRn
</span><a href="#local-6989586621681157343"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType -&gt; SyntaxOpType) -&gt; [TcType] -&gt; [SyntaxOpType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; SyntaxOpType
</span><a href="GHC.Tc.Utils.TcType.html#synKnownType"><span class="hs-identifier hs-var">synKnownType</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157337"><span class="hs-identifier hs-var">pred_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157332"><span class="hs-identifier hs-var">r_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157332"><span class="hs-identifier hs-var">r_ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157332"><span class="hs-identifier hs-var">r_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(([TcType] -&gt; [TcType] -&gt; TcM (LHsExpr GhcTc))
 -&gt; TcM (LHsExpr GhcTc, SyntaxExprTc))
-&gt; ([TcType] -&gt; [TcType] -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc, SyntaxExprTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-184"></span><span>               </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157341"><span class="hs-identifier hs-var">pred</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157337"><span class="hs-identifier hs-var">pred_ty</span></a></span><span>
</span><span id="line-185"></span><span>
</span><span id="line-186"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157320"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157320"><span class="hs-identifier hs-var">b1'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157345"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157340"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157338"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-187"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157319"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157319"><span class="hs-identifier hs-var">b2'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157345"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157339"><span class="hs-identifier hs-var">b2</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><a href="#local-6989586621681157338"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdIf GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; LHsExpr GhcTc
-&gt; LHsCmd GhcTc
-&gt; LHsCmd GhcTc
-&gt; HsCmd GhcTc
forall id.
XCmdIf id
-&gt; SyntaxExpr id
-&gt; LHsExpr id
-&gt; LHsCmd id
-&gt; LHsCmd id
-&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdIf"><span class="hs-identifier hs-var">HsCmdIf</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdIf GhcRn
XCmdIf GhcTc
</span><a href="#local-6989586621681157344"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
SyntaxExprTc
</span><a href="#local-6989586621681157324"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157325"><span class="hs-identifier hs-var">pred'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157320"><span class="hs-identifier hs-var">b1'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157319"><span class="hs-identifier hs-var">b2'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span class="hs-comment">-------------------------------------------</span><span>
</span><span id="line-192"></span><span class="hs-comment">--              Arrow application</span><span>
</span><span id="line-193"></span><span class="hs-comment">--          (f -&lt; a)   or   (f -&lt;&lt; a)</span><span>
</span><span id="line-194"></span><span class="hs-comment">--</span><span>
</span><span id="line-195"></span><span class="hs-comment">--   D   |- fun :: a t1 t2</span><span>
</span><span id="line-196"></span><span class="hs-comment">--   D,G |- arg :: t1</span><span>
</span><span id="line-197"></span><span class="hs-comment">--  ------------------------</span><span>
</span><span id="line-198"></span><span class="hs-comment">--   D;G |-a  fun -&lt; arg :: stk --&gt; t2</span><span>
</span><span id="line-199"></span><span class="hs-comment">--</span><span>
</span><span id="line-200"></span><span class="hs-comment">--   D,G |- fun :: a t1 t2</span><span>
</span><span id="line-201"></span><span class="hs-comment">--   D,G |- arg :: t1</span><span>
</span><span id="line-202"></span><span class="hs-comment">--  ------------------------</span><span>
</span><span id="line-203"></span><span class="hs-comment">--   D;G |-a  fun -&lt;&lt; arg :: stk --&gt; t2</span><span>
</span><span id="line-204"></span><span class="hs-comment">--</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- (plus -&lt;&lt; requires ArrowApply)</span><span>
</span><span id="line-206"></span><span>
</span><span id="line-207"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157318"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157318"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157317"><span class="annot"><span class="annottext">cmd :: HsCmd GhcRn
</span><a href="#local-6989586621681157317"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdArrApp"><span class="hs-identifier hs-type">HsCmdArrApp</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdArrApp GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681157315"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157315"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681157314"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157314"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621681157313"><span class="annot"><span class="annottext">HsArrAppType
</span><a href="#local-6989586621681157313"><span class="hs-identifier hs-var">ho_app</span></a></span></span><span> </span><span id="local-6989586621681157312"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681157312"><span class="hs-identifier hs-var">lr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157311"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157311"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var">cmdCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157317"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span>    </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-209"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157310"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157310"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newOpenFlexiTyVarTy"><span class="hs-identifier hs-var">newOpenFlexiTyVarTy</span></a></span><span>
</span><span id="line-210"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157309"><span class="annot"><span class="annottext">fun_ty :: TcType
</span><a href="#local-6989586621681157309"><span class="hs-identifier hs-var hs-var">fun_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkCmdArrTy"><span class="hs-identifier hs-var">mkCmdArrTy</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157318"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157310"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157311"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-211"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157308"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157308"><span class="hs-identifier hs-var">fun'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
</span><a href="#local-6989586621681157307"><span class="hs-identifier hs-var">select_arrow_scope</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157315"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157309"><span class="hs-identifier hs-var">fun_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157306"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157306"><span class="hs-identifier hs-var">arg'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157314"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157310"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdArrApp GhcTc
-&gt; LHsExpr GhcTc
-&gt; LHsExpr GhcTc
-&gt; HsArrAppType
-&gt; Bool
-&gt; HsCmd GhcTc
forall id.
XCmdArrApp id
-&gt; LHsExpr id -&gt; LHsExpr id -&gt; HsArrAppType -&gt; Bool -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdArrApp"><span class="hs-identifier hs-var">HsCmdArrApp</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
XCmdArrApp GhcTc
</span><a href="#local-6989586621681157309"><span class="hs-identifier hs-var">fun_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157308"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157306"><span class="hs-identifier hs-var">arg'</span></a></span><span> </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="#local-6989586621681157313"><span class="hs-identifier hs-var">ho_app</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681157312"><span class="hs-identifier hs-var">lr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-217"></span><span>       </span><span class="hs-comment">-- Before type-checking f, use the environment of the enclosing</span><span>
</span><span id="line-218"></span><span>       </span><span class="hs-comment">-- proc for the (-&lt;) case.</span><span>
</span><span id="line-219"></span><span>       </span><span class="hs-comment">-- Local bindings, inside the enclosing proc, are not in scope</span><span>
</span><span id="line-220"></span><span>       </span><span class="hs-comment">-- inside f.  In the higher-order case (-&lt;&lt;), they are.</span><span>
</span><span id="line-221"></span><span>       </span><span class="hs-comment">-- See Note [Escaping the arrow scope] in GHC.Tc.Types</span><span>
</span><span id="line-222"></span><span>    </span><span id="local-6989586621681157307"><span class="annot"><span class="annottext">select_arrow_scope :: TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
</span><a href="#local-6989586621681157307"><span class="hs-identifier hs-var hs-var">select_arrow_scope</span></a></span></span><span> </span><span id="local-6989586621681157305"><span class="annot"><span class="annottext">TcM (LHsExpr GhcTc)
</span><a href="#local-6989586621681157305"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="#local-6989586621681157313"><span class="hs-identifier hs-var">ho_app</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-223"></span><span>        </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="GHC.Hs.Expr.html#HsHigherOrderApp"><span class="hs-identifier hs-var">HsHigherOrderApp</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcM (LHsExpr GhcTc)
</span><a href="#local-6989586621681157305"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-224"></span><span>        </span><span class="annot"><span class="annottext">HsArrAppType
</span><a href="GHC.Hs.Expr.html#HsFirstOrderApp"><span class="hs-identifier hs-var">HsFirstOrderApp</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#escapeArrowScope"><span class="hs-identifier hs-var">escapeArrowScope</span></a></span><span> </span><span class="annot"><span class="annottext">TcM (LHsExpr GhcTc)
</span><a href="#local-6989586621681157305"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span class="hs-comment">-------------------------------------------</span><span>
</span><span id="line-227"></span><span class="hs-comment">--              Command application</span><span>
</span><span id="line-228"></span><span class="hs-comment">--</span><span>
</span><span id="line-229"></span><span class="hs-comment">-- D,G |-  exp : t</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- D;G |-a cmd : (t,stk) --&gt; res</span><span>
</span><span id="line-231"></span><span class="hs-comment">-- -----------------------------</span><span>
</span><span id="line-232"></span><span class="hs-comment">-- D;G |-a cmd exp : stk --&gt; res</span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157301"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157301"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157300"><span class="annot"><span class="annottext">cmd :: HsCmd GhcRn
</span><a href="#local-6989586621681157300"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdApp"><span class="hs-identifier hs-type">HsCmdApp</span></a></span><span> </span><span id="local-6989586621681157298"><span class="annot"><span class="annottext">XCmdApp GhcRn
</span><a href="#local-6989586621681157298"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157297"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157297"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621681157296"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157296"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157295"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157295"><span class="hs-identifier hs-var">cmd_stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157294"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157294"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-235"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var">cmdCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157300"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span>    </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-236"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157293"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157293"><span class="hs-identifier hs-var">arg_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newOpenFlexiTyVarTy"><span class="hs-identifier hs-var">newOpenFlexiTyVarTy</span></a></span><span>
</span><span id="line-237"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157292"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157292"><span class="hs-identifier hs-var">fun'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157301"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157297"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkPairTy"><span class="hs-identifier hs-var">mkPairTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157293"><span class="hs-identifier hs-var">arg_ty</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157295"><span class="hs-identifier hs-var">cmd_stk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157294"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157290"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157290"><span class="hs-identifier hs-var">arg'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckMonoExpr"><span class="hs-identifier hs-var">tcCheckMonoExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157296"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157293"><span class="hs-identifier hs-var">arg_ty</span></a></span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdApp GhcTc -&gt; LHsCmd GhcTc -&gt; LHsExpr GhcTc -&gt; HsCmd GhcTc
forall id. XCmdApp id -&gt; LHsCmd id -&gt; LHsExpr id -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdApp"><span class="hs-identifier hs-var">HsCmdApp</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdApp GhcRn
XCmdApp GhcTc
</span><a href="#local-6989586621681157298"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157292"><span class="hs-identifier hs-var">fun'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157290"><span class="hs-identifier hs-var">arg'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-comment">-------------------------------------------</span><span>
</span><span id="line-242"></span><span class="hs-comment">--              Lambda</span><span>
</span><span id="line-243"></span><span class="hs-comment">--</span><span>
</span><span id="line-244"></span><span class="hs-comment">-- D;G,x:t |-a cmd : stk --&gt; res</span><span>
</span><span id="line-245"></span><span class="hs-comment">-- ------------------------------</span><span>
</span><span id="line-246"></span><span class="hs-comment">-- D;G |-a (\x.cmd) : (t,stk) --&gt; res</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157289"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157289"><span class="hs-identifier hs-var">env</span></a></span></span><span>
</span><span id="line-249"></span><span>       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdLam"><span class="hs-identifier hs-type">HsCmdLam</span></a></span><span> </span><span id="local-6989586621681157287"><span class="annot"><span class="annottext">XCmdLam GhcRn
</span><a href="#local-6989586621681157287"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157284"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157284"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157283"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157283"><span class="hs-identifier hs-var">mtch_loc</span></a></span></span><span>
</span><span id="line-250"></span><span>                                   </span><span class="hs-special">(</span><span id="local-6989586621681157282"><span class="annot"><span class="annottext">match :: Match GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157282"><span class="hs-identifier hs-var">match</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157279"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681157279"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157277"><span class="annot"><span class="annottext">GRHSs GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157277"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-251"></span><span>                         </span><span class="annot"><span class="annottext">mg_origin :: forall p body. MatchGroup p body -&gt; Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157275"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681157275"><span class="hs-identifier hs-var">origin</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681157274"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157274"><span class="hs-identifier hs-var">cmd_stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157273"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157273"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match GhcRn (LHsCmd GhcRn) -&gt; MsgDoc
forall (idR :: Pass) body.
(OutputableBndrId idR, Outputable body) =&gt;
Match (GhcPass idR) body -&gt; MsgDoc
</span><a href="GHC.Hs.Expr.html#pprMatchInCtxt"><span class="hs-identifier hs-var">pprMatchInCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Match GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157282"><span class="hs-identifier hs-var">match</span></a></span><span class="hs-special">)</span><span>        </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-254"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157271"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157271"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157270"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157270"><span class="hs-identifier hs-var">arg_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157269"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157269"><span class="hs-identifier hs-var">cmd_stk'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcType -&gt; TcM (TcCoercion, [TcType], TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-var">matchExpectedCmdArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681157268"><span class="hs-identifier hs-var">n_pats</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157274"><span class="hs-identifier hs-var">cmd_stk</span></a></span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span>                </span><span class="hs-comment">-- Check the patterns, and the GRHSs inside</span><span>
</span><span id="line-257"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157267"><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
</span><a href="#local-6989586621681157267"><span class="hs-identifier hs-var">pats'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157266"><span class="annot"><span class="annottext">GRHSs GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157266"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc))
-&gt; TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc))
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157283"><span class="hs-identifier hs-var">mtch_loc</span></a></span><span>                                 </span><span class="annot"><span class="annottext">(TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc))
 -&gt; TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc)))
-&gt; TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc))
-&gt; TcRn ([Located (Pat GhcTc)], GRHSs GhcTc (LHsCmd GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-258"></span><span>                             </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; [LPat GhcRn]
-&gt; [Scaled ExpRhoType]
-&gt; TcM (GRHSs GhcTc (LHsCmd GhcTc))
-&gt; TcM ([LPat GhcTc], GRHSs GhcTc (LHsCmd GhcTc))
forall a.
HsMatchContext GhcRn
-&gt; [LPat GhcRn]
-&gt; [Scaled ExpRhoType]
-&gt; TcM a
-&gt; TcM ([LPat GhcTc], a)
</span><a href="GHC.Tc.Gen.Pat.html#tcPats"><span class="hs-identifier hs-var">tcPats</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681157279"><span class="hs-identifier hs-var">pats</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType -&gt; Scaled ExpRhoType) -&gt; [TcType] -&gt; [Scaled ExpRhoType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExpRhoType -&gt; Scaled ExpRhoType
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">(ExpRhoType -&gt; Scaled ExpRhoType)
-&gt; (TcType -&gt; ExpRhoType) -&gt; TcType -&gt; Scaled ExpRhoType
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157270"><span class="hs-identifier hs-var">arg_tys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (GRHSs GhcTc (LHsCmd GhcTc))
 -&gt; TcM ([LPat GhcTc], GRHSs GhcTc (LHsCmd GhcTc)))
-&gt; TcM (GRHSs GhcTc (LHsCmd GhcTc))
-&gt; TcM ([LPat GhcTc], GRHSs GhcTc (LHsCmd GhcTc))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-259"></span><span>                             </span><span class="annot"><span class="annottext">GRHSs GhcRn (LHsCmd GhcRn)
-&gt; TcType -&gt; ExpRhoType -&gt; TcM (GRHSs GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157262"><span class="hs-identifier hs-var">tc_grhss</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157277"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157269"><span class="hs-identifier hs-var">cmd_stk'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157273"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157261"><span class="annot"><span class="annottext">match' :: GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157261"><span class="hs-identifier hs-var hs-var">match'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; Match GhcTc (LHsCmd GhcTc)
-&gt; GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157283"><span class="hs-identifier hs-var">mtch_loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match :: forall p body.
XCMatch p body
-&gt; HsMatchContext (NoGhcTc p)
-&gt; [LPat p]
-&gt; GRHSs p body
-&gt; Match p body
</span><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_ext :: XCMatch GhcTc (LHsCmd GhcTc)
</span><a href="GHC.Hs.Expr.html#m_ext"><span class="hs-identifier hs-var">m_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XCMatch GhcTc (LHsCmd GhcTc)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-262"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_ctxt :: HsMatchContext (NoGhcTc GhcTc)
</span><a href="GHC.Hs.Expr.html#m_ctxt"><span class="hs-identifier hs-var">m_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcTc)
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_pats :: [LPat GhcTc]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
[LPat GhcTc]
</span><a href="#local-6989586621681157267"><span class="hs-identifier hs-var">pats'</span></a></span><span>
</span><span id="line-263"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: GRHSs GhcTc (LHsCmd GhcTc)
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157266"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span>              </span><span id="local-6989586621681157257"><span class="annot"><span class="annottext">arg_tys :: [Scaled TcType]
</span><a href="#local-6989586621681157257"><span class="hs-identifier hs-var hs-var">arg_tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Located (Pat GhcTc) -&gt; Scaled TcType)
-&gt; [Located (Pat GhcTc)] -&gt; [Scaled TcType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Scaled TcType
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; Scaled TcType)
-&gt; (Located (Pat GhcTc) -&gt; TcType)
-&gt; Located (Pat GhcTc)
-&gt; Scaled TcType
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc) -&gt; TcType
LPat GhcTc -&gt; TcType
</span><a href="GHC.Tc.Utils.Zonk.html#hsLPatType"><span class="hs-identifier hs-var">hsLPatType</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcTc)]
</span><a href="#local-6989586621681157267"><span class="hs-identifier hs-var">pats'</span></a></span><span>
</span><span id="line-265"></span><span>              </span><span id="local-6989586621681157256"><span class="annot"><span class="annottext">cmd' :: HsCmd GhcTc
</span><a href="#local-6989586621681157256"><span class="hs-identifier hs-var hs-var">cmd'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">XCmdLam GhcTc -&gt; MatchGroup GhcTc (LHsCmd GhcTc) -&gt; HsCmd GhcTc
forall id. XCmdLam id -&gt; MatchGroup id (LHsCmd id) -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdLam"><span class="hs-identifier hs-var">HsCmdLam</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdLam GhcRn
XCmdLam GhcTc
</span><a href="#local-6989586621681157287"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MG :: forall p body.
XMG p body
-&gt; Located [LMatch p body] -&gt; Origin -&gt; MatchGroup p body
</span><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: Located [GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; [GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))]
-&gt; Located [GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157284"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GenLocated SrcSpan (Match GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157261"><span class="hs-identifier hs-var">match'</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-266"></span><span>                                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_ext :: XMG GhcTc (LHsCmd GhcTc)
</span><a href="GHC.Hs.Expr.html#mg_ext"><span class="hs-identifier hs-var">mg_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Scaled TcType] -&gt; TcType -&gt; MatchGroupTc
</span><a href="GHC.Hs.Expr.html#MatchGroupTc"><span class="hs-identifier hs-var">MatchGroupTc</span></a></span><span> </span><span class="annot"><span class="annottext">[Scaled TcType]
</span><a href="#local-6989586621681157257"><span class="hs-identifier hs-var">arg_tys</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157273"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-267"></span><span>                                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681157275"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; HsCmd GhcTc -&gt; HsCmd GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsCmdWrap"><span class="hs-identifier hs-var">mkHsCmdWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcCoercion -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpCastN"><span class="hs-identifier hs-var">mkWpCastN</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157271"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc
</span><a href="#local-6989586621681157256"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-270"></span><span>    </span><span id="local-6989586621681157268"><span class="annot"><span class="annottext">n_pats :: Arity
</span><a href="#local-6989586621681157268"><span class="hs-identifier hs-var hs-var">n_pats</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (Pat GhcRn)]
[LPat GhcRn]
</span><a href="#local-6989586621681157279"><span class="hs-identifier hs-var">pats</span></a></span><span>
</span><span id="line-271"></span><span>    </span><span id="local-6989586621681157252"><span class="annot"><span class="annottext">match_ctxt :: HsMatchContext GhcRn
</span><a href="#local-6989586621681157252"><span class="hs-identifier hs-var hs-var">match_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- Maybe KappaExpr?</span><span>
</span><span id="line-272"></span><span>    </span><span id="local-6989586621681157251"><span class="annot"><span class="annottext">pg_ctxt :: HsStmtContext GhcRn
</span><a href="#local-6989586621681157251"><span class="hs-identifier hs-var hs-var">pg_ctxt</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsMatchContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#PatGuard"><span class="hs-identifier hs-var">PatGuard</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681157252"><span class="hs-identifier hs-var">match_ctxt</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>    </span><span id="local-6989586621681157262"><span class="annot"><span class="annottext">tc_grhss :: GRHSs GhcRn (LHsCmd GhcRn)
-&gt; TcType -&gt; ExpRhoType -&gt; TcM (GRHSs GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157262"><span class="hs-identifier hs-var hs-var">tc_grhss</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span id="local-6989586621681157248"><span class="annot"><span class="annottext">XCGRHSs GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157248"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157247"><span class="annot"><span class="annottext">[LGRHS GhcRn (LHsCmd GhcRn)]
</span><a href="#local-6989586621681157247"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157246"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157246"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681157245"><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681157245"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157244"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157244"><span class="hs-identifier hs-var">stk_ty</span></a></span></span><span> </span><span id="local-6989586621681157243"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157243"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span>
</span><span id="line-275"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157242"><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681157242"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157241"><span class="annot"><span class="annottext">[Located (GRHS GhcTc (LHsCmd GhcTc))]
</span><a href="#local-6989586621681157241"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
-&gt; TcM [Located (GRHS GhcTc (LHsCmd GhcTc))]
-&gt; TcM (HsLocalBinds GhcTc, [Located (GRHS GhcTc (LHsCmd GhcTc))])
forall thing.
HsLocalBinds GhcRn -&gt; TcM thing -&gt; TcM (HsLocalBinds GhcTc, thing)
</span><a href="GHC.Tc.Gen.Bind.html#tcLocalBinds"><span class="hs-identifier hs-var">tcLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681157245"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM [Located (GRHS GhcTc (LHsCmd GhcTc))]
 -&gt; TcM (HsLocalBinds GhcTc, [Located (GRHS GhcTc (LHsCmd GhcTc))]))
-&gt; TcM [Located (GRHS GhcTc (LHsCmd GhcTc))]
-&gt; TcM (HsLocalBinds GhcTc, [Located (GRHS GhcTc (LHsCmd GhcTc))])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-276"></span><span>                                   </span><span class="annot"><span class="annottext">(LGRHS GhcRn (LHsCmd GhcRn)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv) (Located (GRHS GhcTc (LHsCmd GhcTc))))
-&gt; [LGRHS GhcRn (LHsCmd GhcRn)]
-&gt; TcM [Located (GRHS GhcTc (LHsCmd GhcTc))]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GRHS GhcRn (LHsCmd GhcRn) -&gt; TcM (GRHS GhcTc (LHsCmd GhcTc)))
-&gt; LGRHS GhcRn (LHsCmd GhcRn)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (Located (GRHS GhcTc (LHsCmd GhcTc)))
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
-&gt; ExpRhoType
-&gt; GRHS GhcRn (LHsCmd GhcRn)
-&gt; TcM (GRHS GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157239"><span class="hs-identifier hs-var">tc_grhs</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157244"><span class="hs-identifier hs-var">stk_ty</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157243"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcRn (LHsCmd GhcRn)]
</span><a href="#local-6989586621681157247"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-277"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsCmd GhcTc) -&gt; TcM (GRHSs GhcTc (LHsCmd GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHSs GhcTc (LHsCmd GhcTc)
-&gt; [Located (GRHS GhcTc (LHsCmd GhcTc))]
-&gt; LHsLocalBinds GhcTc
-&gt; GRHSs GhcTc (LHsCmd GhcTc)
forall p body.
XCGRHSs p body -&gt; [LGRHS p body] -&gt; LHsLocalBinds p -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-var">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs GhcRn (LHsCmd GhcRn)
XCGRHSs GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157248"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (GRHS GhcTc (LHsCmd GhcTc))]
</span><a href="#local-6989586621681157241"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsLocalBinds GhcTc -&gt; LHsLocalBinds GhcTc
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157246"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcTc
</span><a href="#local-6989586621681157242"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-278"></span><span>
</span><span id="line-279"></span><span>    </span><span id="local-6989586621681157239"><span class="annot"><span class="annottext">tc_grhs :: TcType
-&gt; ExpRhoType
-&gt; GRHS GhcRn (LHsCmd GhcRn)
-&gt; TcM (GRHS GhcTc (LHsCmd GhcTc))
</span><a href="#local-6989586621681157239"><span class="hs-identifier hs-var hs-var">tc_grhs</span></a></span></span><span> </span><span id="local-6989586621681157238"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157238"><span class="hs-identifier hs-var">stk_ty</span></a></span></span><span> </span><span id="local-6989586621681157237"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157237"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span id="local-6989586621681157235"><span class="annot"><span class="annottext">XCGRHS GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157235"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157234"><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681157234"><span class="hs-identifier hs-var">guards</span></a></span></span><span> </span><span id="local-6989586621681157233"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157233"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-280"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157232"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681157232"><span class="hs-identifier hs-var">guards'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157231"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157231"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsExpr ExpRhoType
-&gt; [GuardLStmt GhcRn]
-&gt; ExpRhoType
-&gt; (ExpRhoType -&gt; TcM (LHsCmd GhcTc))
-&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], LHsCmd GhcTc)
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681157251"><span class="hs-identifier hs-var">pg_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TcStmtChecker HsExpr ExpRhoType
</span><a href="GHC.Tc.Gen.Match.html#tcGuardStmt"><span class="hs-identifier hs-var">tcGuardStmt</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcRn]
</span><a href="#local-6989586621681157234"><span class="hs-identifier hs-var">guards</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157237"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="annot"><span class="annottext">((ExpRhoType -&gt; TcM (LHsCmd GhcTc))
 -&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], LHsCmd GhcTc))
-&gt; (ExpRhoType -&gt; TcM (LHsCmd GhcTc))
-&gt; TcM ([LStmt GhcTc (LHsExpr GhcTc)], LHsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-281"></span><span>                                  </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681157228"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157228"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157289"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157233"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-282"></span><span>                                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157238"><span class="hs-identifier hs-var">stk_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; ExpRhoType -&gt; TcType
</span><a href="GHC.Tc.Utils.TcMType.html#checkingExpType"><span class="hs-identifier hs-var">checkingExpType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tc_grhs&quot;</span></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157228"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-283"></span><span>             </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">GRHS GhcTc (LHsCmd GhcTc) -&gt; TcM (GRHS GhcTc (LHsCmd GhcTc))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHS GhcTc (LHsCmd GhcTc)
-&gt; [LStmt GhcTc (LHsExpr GhcTc)]
-&gt; LHsCmd GhcTc
-&gt; GRHS GhcTc (LHsCmd GhcTc)
forall p body.
XCGRHS p body -&gt; [GuardLStmt p] -&gt; body -&gt; GRHS p body
</span><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-var">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS GhcRn (LHsCmd GhcRn)
XCGRHS GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157235"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsExpr GhcTc)]
</span><a href="#local-6989586621681157232"><span class="hs-identifier hs-var">guards'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157231"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-------------------------------------------</span><span>
</span><span id="line-286"></span><span class="hs-comment">--              Do notation</span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157226"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157226"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdDo"><span class="hs-identifier hs-type">HsCmdDo</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdDo GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681157224"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157224"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681157223"><span class="annot"><span class="annottext">[CmdLStmt GhcRn]
</span><a href="#local-6989586621681157223"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157222"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157222"><span class="hs-identifier hs-var">cmd_stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157221"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157221"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157220"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157220"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn) -&gt; TcType -&gt; TcType -&gt; TcM TcCoercion
</span><a href="GHC.Tc.Utils.Unify.html#unifyType"><span class="hs-identifier hs-var">unifyType</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (HsExpr GhcRn)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157222"><span class="hs-identifier hs-var">cmd_stk</span></a></span><span>  </span><span class="hs-comment">-- Expecting empty argument stack</span><span>
</span><span id="line-290"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157218"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsCmd GhcTc)]
</span><a href="#local-6989586621681157218"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsCmd TcType
-&gt; [CmdLStmt GhcRn]
-&gt; TcType
-&gt; TcM [LStmt GhcTc (LHsCmd GhcTc)]
forall (body :: * -&gt; *) rho_type.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; TcM [LStmt GhcTc (Located (body GhcTc))]
</span><a href="GHC.Tc.Gen.Match.html#tcStmts"><span class="hs-identifier hs-var">tcStmts</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
forall p. HsStmtContext p
</span><a href="GHC.Hs.Expr.html#ArrowExpr"><span class="hs-identifier hs-var">ArrowExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdEnv -&gt; TcStmtChecker HsCmd TcType
</span><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157226"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmdLStmt GhcRn]
</span><a href="#local-6989586621681157223"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157221"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-291"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; HsCmd GhcTc -&gt; HsCmd GhcTc
</span><a href="GHC.Hs.Utils.html#mkHsCmdWrap"><span class="hs-identifier hs-var">mkHsCmdWrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcCoercion -&gt; HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#mkWpCastN"><span class="hs-identifier hs-var">mkWpCastN</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157220"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdDo GhcTc -&gt; Located [LStmt GhcTc (LHsCmd GhcTc)] -&gt; HsCmd GhcTc
forall id. XCmdDo id -&gt; Located [CmdLStmt id] -&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdDo"><span class="hs-identifier hs-var">HsCmdDo</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
XCmdDo GhcTc
</span><a href="#local-6989586621681157221"><span class="hs-identifier hs-var">res_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; [LStmt GhcTc (LHsCmd GhcTc)]
-&gt; Located [LStmt GhcTc (LHsCmd GhcTc)]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681157224"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsCmd GhcTc)]
</span><a href="#local-6989586621681157218"><span class="hs-identifier hs-var">stmts'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-295"></span><span class="hs-comment">--      Arrow ``forms''       (| e c1 .. cn |)</span><span>
</span><span id="line-296"></span><span class="hs-comment">--</span><span>
</span><span id="line-297"></span><span class="hs-comment">--      D; G |-a1 c1 : stk1 --&gt; r1</span><span>
</span><span id="line-298"></span><span class="hs-comment">--      ...</span><span>
</span><span id="line-299"></span><span class="hs-comment">--      D; G |-an cn : stkn --&gt; rn</span><span>
</span><span id="line-300"></span><span class="hs-comment">--      D |-  e :: forall e. a1 (e, stk1) t1</span><span>
</span><span id="line-301"></span><span class="hs-comment">--                                ...</span><span>
</span><span id="line-302"></span><span class="hs-comment">--                        -&gt; an (e, stkn) tn</span><span>
</span><span id="line-303"></span><span class="hs-comment">--                        -&gt; a  (e, stk) t</span><span>
</span><span id="line-304"></span><span class="hs-comment">--      e \not\in (stk, stk1, ..., stkm, t, t1, ..., tn)</span><span>
</span><span id="line-305"></span><span class="hs-comment">--      ----------------------------------------------</span><span>
</span><span id="line-306"></span><span class="hs-comment">--      D; G |-a  (| e c1 ... cn |)  :  stk --&gt; t</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span id="local-6989586621681157214"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157214"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157213"><span class="annot"><span class="annottext">cmd :: HsCmd GhcRn
</span><a href="#local-6989586621681157213"><span class="hs-identifier hs-var">cmd</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmdArrForm"><span class="hs-identifier hs-type">HsCmdArrForm</span></a></span><span> </span><span id="local-6989586621681157211"><span class="annot"><span class="annottext">XCmdArrForm GhcRn
</span><a href="#local-6989586621681157211"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157210"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157210"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span id="local-6989586621681157209"><span class="annot"><span class="annottext">LexicalFixity
</span><a href="#local-6989586621681157209"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681157208"><span class="annot"><span class="annottext">Maybe Fixity
</span><a href="#local-6989586621681157208"><span class="hs-identifier hs-var">fixity</span></a></span></span><span> </span><span id="local-6989586621681157207"><span class="annot"><span class="annottext">[LHsCmdTop GhcRn]
</span><a href="#local-6989586621681157207"><span class="hs-identifier hs-var">cmd_args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157206"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157206"><span class="hs-identifier hs-var">cmd_stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157205"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157205"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var">cmdCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157213"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span>    </span><span class="annot"><span class="annottext">(TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc))
-&gt; TcM (HsCmd GhcTc) -&gt; TcM (HsCmd GhcTc)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-310"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157204"><span class="annot"><span class="annottext">[LHsCmdTop GhcTc]
</span><a href="#local-6989586621681157204"><span class="hs-identifier hs-var">cmd_args'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157203"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157203"><span class="hs-identifier hs-var">cmd_tys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsCmdTop GhcRn
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsCmdTop GhcTc, TcType))
-&gt; [LHsCmdTop GhcRn]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsCmdTop GhcTc], [TcType])
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; m (b, c)) -&gt; [a] -&gt; m ([b], [c])
</span><a href="../../base/src/Control.Monad.html#mapAndUnzipM"><span class="hs-identifier hs-var">mapAndUnzipM</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmdTop GhcRn
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsCmdTop GhcTc, TcType)
</span><a href="#local-6989586621681157201"><span class="hs-identifier hs-var">tc_cmd_arg</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsCmdTop GhcRn]
</span><a href="#local-6989586621681157207"><span class="hs-identifier hs-var">cmd_args</span></a></span><span>
</span><span id="line-311"></span><span>                              </span><span class="hs-comment">-- We use alphaTyVar for 'w'</span><span>
</span><span id="line-312"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157200"><span class="annot"><span class="annottext">e_ty :: TcType
</span><a href="#local-6989586621681157200"><span class="hs-identifier hs-var hs-var">e_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcTyVar -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.Type.html#mkInfForAllTy"><span class="hs-identifier hs-var">mkInfForAllTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcTyVar
</span><a href="GHC.Builtin.Types.Prim.html#alphaTyVar"><span class="hs-identifier hs-var">alphaTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; TcType) -&gt; TcType -&gt; TcType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-313"></span><span>                     </span><span class="annot"><span class="annottext">[TcType] -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157203"><span class="hs-identifier hs-var">cmd_tys</span></a></span><span> </span><span class="annot"><span class="annottext">(TcType -&gt; TcType) -&gt; TcType -&gt; TcType
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-314"></span><span>                     </span><span class="annot"><span class="annottext">CmdEnv -&gt; TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkCmdArrTy"><span class="hs-identifier hs-var">mkCmdArrTy</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157214"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkPairTy"><span class="hs-identifier hs-var">mkPairTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157206"><span class="hs-identifier hs-var">cmd_stk</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157205"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-315"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157196"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157196"><span class="hs-identifier hs-var">expr'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn -&gt; TcType -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681157210"><span class="hs-identifier hs-var">expr</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157200"><span class="hs-identifier hs-var">e_ty</span></a></span><span>
</span><span id="line-316"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsCmd GhcTc -&gt; TcM (HsCmd GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCmdArrForm GhcTc
-&gt; LHsExpr GhcTc
-&gt; LexicalFixity
-&gt; Maybe Fixity
-&gt; [LHsCmdTop GhcTc]
-&gt; HsCmd GhcTc
forall id.
XCmdArrForm id
-&gt; LHsExpr id
-&gt; LexicalFixity
-&gt; Maybe Fixity
-&gt; [LHsCmdTop id]
-&gt; HsCmd id
</span><a href="GHC.Hs.Expr.html#HsCmdArrForm"><span class="hs-identifier hs-var">HsCmdArrForm</span></a></span><span> </span><span class="annot"><span class="annottext">XCmdArrForm GhcRn
XCmdArrForm GhcTc
</span><a href="#local-6989586621681157211"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681157196"><span class="hs-identifier hs-var">expr'</span></a></span><span> </span><span class="annot"><span class="annottext">LexicalFixity
</span><a href="#local-6989586621681157209"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Fixity
</span><a href="#local-6989586621681157208"><span class="hs-identifier hs-var">fixity</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsCmdTop GhcTc]
</span><a href="#local-6989586621681157204"><span class="hs-identifier hs-var">cmd_args'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-319"></span><span>    </span><span class="annot"><a href="#local-6989586621681157201"><span class="hs-identifier hs-type">tc_cmd_arg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmdTop"><span class="hs-identifier hs-type">LHsCmdTop</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span>    </span><span id="local-6989586621681157201"><span class="annot"><span class="annottext">tc_cmd_arg :: LHsCmdTop GhcRn
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsCmdTop GhcTc, TcType)
</span><a href="#local-6989586621681157201"><span class="hs-identifier hs-var hs-var">tc_cmd_arg</span></a></span></span><span> </span><span id="local-6989586621681157195"><span class="annot"><span class="annottext">LHsCmdTop GhcRn
</span><a href="#local-6989586621681157195"><span class="hs-identifier hs-var">cmd</span></a></span></span><span>
</span><span id="line-321"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157194"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157194"><span class="hs-identifier hs-var">arr_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Tc.Gen.Arrow.html#arrowTyConKind"><span class="hs-identifier hs-var">arrowTyConKind</span></a></span><span>
</span><span id="line-322"></span><span>            </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157191"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157191"><span class="hs-identifier hs-var">stk_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-323"></span><span>            </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157189"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157189"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-324"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157188"><span class="annot"><span class="annottext">env' :: CmdEnv
</span><a href="#local-6989586621681157188"><span class="hs-identifier hs-var hs-var">env'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157214"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cmd_arr :: TcType
</span><a href="GHC.Tc.Gen.Arrow.html#cmd_arr"><span class="hs-identifier hs-var">cmd_arr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157194"><span class="hs-identifier hs-var">arr_ty</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-325"></span><span>            </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157187"><span class="annot"><span class="annottext">LHsCmdTop GhcTc
</span><a href="#local-6989586621681157187"><span class="hs-identifier hs-var">cmd'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv
-&gt; LHsCmdTop GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmdTop GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdTop"><span class="hs-identifier hs-var">tcCmdTop</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157188"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmdTop GhcRn
</span><a href="#local-6989586621681157195"><span class="hs-identifier hs-var">cmd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157191"><span class="hs-identifier hs-var">stk_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157189"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-326"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsCmdTop GhcTc, TcType)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsCmdTop GhcTc, TcType)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsCmdTop GhcTc
</span><a href="#local-6989586621681157187"><span class="hs-identifier hs-var">cmd'</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">CmdEnv -&gt; TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkCmdArrTy"><span class="hs-identifier hs-var">mkCmdArrTy</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157188"><span class="hs-identifier hs-var">env'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkPairTy"><span class="hs-identifier hs-var">mkPairTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.Prim.html#alphaTy"><span class="hs-identifier hs-var">alphaTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157191"><span class="hs-identifier hs-var">stk_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157189"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-327"></span><span>
</span><span id="line-328"></span><span class="hs-comment">-----------------------------------------------------------------</span><span>
</span><span id="line-329"></span><span class="hs-comment">--              Base case for illegal commands</span><span>
</span><span id="line-330"></span><span class="hs-comment">-- This is where expressions that aren't commands get rejected</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_cmd"><span class="hs-identifier hs-var">tc_cmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681157186"><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157186"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span class="annot"><span class="annottext">(TcType, TcType)
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (HsCmd GhcTc)
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The expression&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157186"><span class="hs-identifier hs-var">cmd</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-334"></span><span>                      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;was found where an arrow command was expected&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span class="hs-comment">-- | Typechecking for case command alternatives. Used for both</span><span>
</span><span id="line-337"></span><span class="hs-comment">-- 'HsCmdCase' and 'HsCmdLamCase'.</span><span>
</span><span id="line-338"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcCmdMatches"><span class="hs-identifier hs-type">tcCmdMatches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span>
</span><span id="line-339"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span>                           </span><span class="hs-comment">-- ^ type of the scrutinee</span><span>
</span><span id="line-340"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ case alternatives</span><span>
</span><span id="line-341"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdType"><span class="hs-identifier hs-type">CmdType</span></a></span><span>
</span><span id="line-342"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span id="tcCmdMatches"><span class="annot"><span class="annottext">tcCmdMatches :: CmdEnv
-&gt; TcType
-&gt; MatchGroup GhcRn (LHsCmd GhcRn)
-&gt; (TcType, TcType)
-&gt; TcM (MatchGroup GhcTc (LHsCmd GhcTc))
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmdMatches"><span class="hs-identifier hs-var hs-var">tcCmdMatches</span></a></span></span><span> </span><span id="local-6989586621681157181"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157181"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157180"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157180"><span class="hs-identifier hs-var">scrut_ty</span></a></span></span><span> </span><span id="local-6989586621681157179"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157179"><span class="hs-identifier hs-var">matches</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157178"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157178"><span class="hs-identifier hs-var">stk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157177"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157177"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsCmd
-&gt; Scaled TcType
-&gt; MatchGroup GhcRn (LHsCmd GhcRn)
-&gt; ExpRhoType
-&gt; TcM (MatchGroup GhcTc (LHsCmd GhcTc))
forall (body :: * -&gt; *).
Outputable (body GhcRn) =&gt;
TcMatchCtxt body
-&gt; Scaled TcType
-&gt; MatchGroup GhcRn (Located (body GhcRn))
-&gt; ExpRhoType
-&gt; TcM (MatchGroup GhcTc (Located (body GhcTc)))
</span><a href="GHC.Tc.Gen.Match.html#tcMatchesCase"><span class="hs-identifier hs-var">tcMatchesCase</span></a></span><span> </span><span class="annot"><span class="annottext">TcMatchCtxt HsCmd
</span><a href="#local-6989586621681157175"><span class="hs-identifier hs-var">match_ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Scaled TcType
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157180"><span class="hs-identifier hs-var">scrut_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157179"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157177"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-346"></span><span>    </span><span id="local-6989586621681157175"><span class="annot"><span class="annottext">match_ctxt :: TcMatchCtxt HsCmd
</span><a href="#local-6989586621681157175"><span class="hs-identifier hs-var hs-var">match_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MC :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcRn)
    -&gt; ExpRhoType -&gt; TcM (Located (body GhcTc)))
-&gt; TcMatchCtxt body
</span><a href="GHC.Tc.Gen.Match.html#MC"><span class="hs-identifier hs-type">MC</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_what :: HsMatchContext GhcRn
</span><a href="GHC.Tc.Gen.Match.html#mc_what"><span class="hs-identifier hs-var">mc_what</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#CaseAlt"><span class="hs-identifier hs-var">CaseAlt</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-347"></span><span>                      </span><span class="annot"><span class="annottext">mc_body :: LHsCmd GhcRn -&gt; ExpRhoType -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Match.html#mc_body"><span class="hs-identifier hs-var">mc_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn -&gt; ExpRhoType -&gt; TcM (LHsCmd GhcTc)
</span><a href="#local-6989586621681157170"><span class="hs-identifier hs-var">mc_body</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-348"></span><span>    </span><span id="local-6989586621681157170"><span class="annot"><span class="annottext">mc_body :: LHsCmd GhcRn -&gt; ExpRhoType -&gt; TcM (LHsCmd GhcTc)
</span><a href="#local-6989586621681157170"><span class="hs-identifier hs-var hs-var">mc_body</span></a></span></span><span> </span><span id="local-6989586621681157169"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157169"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span id="local-6989586621681157168"><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157168"><span class="hs-identifier hs-var">res_ty'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157167"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157167"><span class="hs-identifier hs-var">res_ty'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ExpRhoType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#expTypeToType"><span class="hs-identifier hs-var">expTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">ExpRhoType
</span><a href="#local-6989586621681157168"><span class="hs-identifier hs-var">res_ty'</span></a></span><span>
</span><span id="line-349"></span><span>                              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157181"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157169"><span class="hs-identifier hs-var">body</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157178"><span class="hs-identifier hs-var">stk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157167"><span class="hs-identifier hs-var">res_ty'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-type">matchExpectedCmdArgs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcCoercionN"><span class="hs-identifier hs-type">TcCoercionN</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-352"></span><span id="matchExpectedCmdArgs"><span class="annot"><span class="annottext">matchExpectedCmdArgs :: Arity -&gt; TcType -&gt; TcM (TcCoercion, [TcType], TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-var hs-var">matchExpectedCmdArgs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621681157165"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157165"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-353"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TcCoercion, [TcType], TcType)
-&gt; TcM (TcCoercion, [TcType], TcType)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; TcCoercion
</span><a href="GHC.Tc.Types.Evidence.html#mkTcNomReflCo"><span class="hs-identifier hs-var">mkTcNomReflCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157165"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157165"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-354"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-var">matchExpectedCmdArgs</span></a></span><span> </span><span id="local-6989586621681157164"><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681157164"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681157163"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157163"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157162"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157162"><span class="hs-identifier hs-var">co1</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681157161"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157161"><span class="hs-identifier hs-var">ty1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157160"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157160"><span class="hs-identifier hs-var">ty2</span></a></span></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; TcType -&gt; TcM (TcCoercion, [TcType])
</span><a href="GHC.Tc.Utils.Unify.html#matchExpectedTyConApp"><span class="hs-identifier hs-var">matchExpectedTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#pairTyCon"><span class="hs-identifier hs-var">pairTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157163"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-356"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157157"><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157157"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157156"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157156"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157155"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157155"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcType -&gt; TcM (TcCoercion, [TcType], TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#matchExpectedCmdArgs"><span class="hs-identifier hs-var">matchExpectedCmdArgs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681157164"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Arity -&gt; Arity -&gt; Arity
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157160"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-357"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(TcCoercion, [TcType], TcType)
-&gt; TcM (TcCoercion, [TcType], TcType)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Role -&gt; TyCon -&gt; [TcCoercion] -&gt; TcCoercion
</span><a href="GHC.Tc.Types.Evidence.html#mkTcTyConAppCo"><span class="hs-identifier hs-var">mkTcTyConAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><a href="GHC.Core.Coercion.Axiom.html#Nominal"><span class="hs-identifier hs-var">Nominal</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#pairTyCon"><span class="hs-identifier hs-var">pairTyCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157162"><span class="hs-identifier hs-var">co1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcCoercion
</span><a href="#local-6989586621681157157"><span class="hs-identifier hs-var">co2</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157161"><span class="hs-identifier hs-var">ty1</span></a></span><span class="annot"><span class="annottext">TcType -&gt; [TcType] -&gt; [TcType]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157156"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157155"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-358"></span><span>
</span><span id="line-359"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Stmts
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="hs-comment">--------------------------------</span><span>
</span><span id="line-368"></span><span class="hs-comment">--      Mdo-notation</span><span>
</span><span id="line-369"></span><span class="hs-comment">-- The distinctive features here are</span><span>
</span><span id="line-370"></span><span class="hs-comment">--      (a) RecStmts, and</span><span>
</span><span id="line-371"></span><span class="hs-comment">--      (b) no rebindable syntax</span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-type">tcArrDoStmt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Match.html#TcCmdStmtChecker"><span class="hs-identifier hs-type">TcCmdStmtChecker</span></a></span><span>
</span><span id="line-374"></span><span id="tcArrDoStmt"><span class="annot"><span class="annottext">tcArrDoStmt :: CmdEnv -&gt; TcStmtChecker HsCmd TcType
</span><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var hs-var">tcArrDoStmt</span></a></span></span><span> </span><span id="local-6989586621681157117"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157117"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-type">LastStmt</span></a></span><span> </span><span id="local-6989586621681157115"><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157115"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681157114"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157114"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span id="local-6989586621681157113"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681157113"><span class="hs-identifier hs-var">noret</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157112"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157112"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681157111"><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157111"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-375"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157110"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157110"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157117"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157114"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157112"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157109"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157109"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157111"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TcType
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcArrDoStmt&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-377"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XLastStmt GhcTc GhcTc (LHsCmd GhcTc)
-&gt; LHsCmd GhcTc
-&gt; Maybe Bool
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsCmd GhcTc)
forall idL idR body.
XLastStmt idL idR body
-&gt; body -&gt; Maybe Bool -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#LastStmt"><span class="hs-identifier hs-var">LastStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XLastStmt GhcRn GhcRn (LHsCmd GhcRn)
XLastStmt GhcTc GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157115"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157110"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681157113"><span class="hs-identifier hs-var">noret</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157109"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span id="local-6989586621681157106"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157106"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBodyStmt GhcRn GhcRn (LHsCmd GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681157104"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157104"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157103"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157103"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681157102"><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157102"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-380"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157101"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157101"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157100"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157100"><span class="hs-identifier hs-var">elt_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; TcM (LHsCmd GhcTc, TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_arr_rhs"><span class="hs-identifier hs-var">tc_arr_rhs</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157106"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157104"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-381"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157098"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157098"><span class="hs-identifier hs-var">thing</span></a></span></span><span>          </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157102"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157103"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-382"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBodyStmt GhcTc GhcTc (LHsCmd GhcTc)
-&gt; LHsCmd GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; SyntaxExpr GhcTc
-&gt; Stmt GhcTc (LHsCmd GhcTc)
forall idL idR body.
XBodyStmt idL idR body
-&gt; body -&gt; SyntaxExpr idR -&gt; SyntaxExpr idR -&gt; StmtLR idL idR body
</span><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-var">BodyStmt</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
XBodyStmt GhcTc GhcTc (LHsCmd GhcTc)
</span><a href="#local-6989586621681157100"><span class="hs-identifier hs-var">elt_ty</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157101"><span class="hs-identifier hs-var">rhs'</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SyntaxExpr GhcTc
forall (p :: Pass). IsPass p =&gt; SyntaxExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#noSyntaxExpr"><span class="hs-identifier hs-var">noSyntaxExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157098"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span id="local-6989586621681157097"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157097"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157096"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681157096"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BindStmt"><span class="hs-identifier hs-type">BindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">XBindStmt GhcRn GhcRn (LHsCmd GhcRn)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681157094"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681157094"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681157093"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157093"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157092"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157092"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681157091"><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157091"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157090"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157090"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157089"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157089"><span class="hs-identifier hs-var">pat_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; TcM (LHsCmd GhcTc, TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_arr_rhs"><span class="hs-identifier hs-var">tc_arr_rhs</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157097"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157093"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-386"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157088"><span class="annot"><span class="annottext">Located (Pat GhcTc)
</span><a href="#local-6989586621681157088"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157087"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157087"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcRn
-&gt; Scaled TcType
-&gt; TcM thing
-&gt; TcM (LPat GhcTc, thing)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcRn -&gt; Scaled TcType -&gt; TcM a -&gt; TcM (LPat GhcTc, a)
</span><a href="GHC.Tc.Gen.Pat.html#tcCheckPat"><span class="hs-identifier hs-var">tcCheckPat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsStmtContext GhcRn -&gt; HsMatchContext GhcRn
forall p. HsStmtContext p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Expr.html#StmtCtxt"><span class="hs-identifier hs-var">StmtCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681157096"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681157094"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType -&gt; Scaled TcType
forall a. a -&gt; Scaled a
</span><a href="GHC.Core.Type.html#unrestricted"><span class="hs-identifier hs-var">unrestricted</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157089"><span class="hs-identifier hs-var">pat_ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM thing -&gt; TcM (LPat GhcTc, thing))
-&gt; TcM thing -&gt; TcM (LPat GhcTc, thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-387"></span><span>                            </span><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157091"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157092"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-388"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LPat GhcTc -&gt; LHsCmd GhcTc -&gt; Stmt GhcTc (LHsCmd GhcTc)
forall (bodyR :: * -&gt; *).
LPat GhcTc
-&gt; Located (bodyR GhcTc)
-&gt; StmtLR GhcTc GhcTc (Located (bodyR GhcTc))
</span><a href="GHC.Hs.Utils.html#mkTcBindStmt"><span class="hs-identifier hs-var">mkTcBindStmt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcTc)
LPat GhcTc
</span><a href="#local-6989586621681157088"><span class="hs-identifier hs-var">pat'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157090"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157087"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span id="local-6989586621681157084"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157084"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157083"><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681157083"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#RecStmt"><span class="hs-identifier hs-type">RecStmt</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_stmts :: forall idL idR body. StmtLR idL idR body -&gt; [LStmtLR idL idR body]
</span><a href="GHC.Hs.Expr.html#recS_stmts"><span class="hs-identifier hs-var">recS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157080"><span class="annot"><span class="annottext">[CmdLStmt GhcRn]
</span><a href="#local-6989586621681157080"><span class="hs-identifier hs-var">stmts</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157078"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681157078"><span class="hs-identifier hs-var">later_names</span></a></span></span><span>
</span><span id="line-391"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_ids :: forall idL idR body. StmtLR idL idR body -&gt; [IdP idR]
</span><a href="GHC.Hs.Expr.html#recS_rec_ids"><span class="hs-identifier hs-var">recS_rec_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681157076"><span class="annot"><span class="annottext">[IdP GhcRn]
</span><a href="#local-6989586621681157076"><span class="hs-identifier hs-var">rec_names</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681157075"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157075"><span class="hs-identifier hs-var">res_ty</span></a></span></span><span> </span><span id="local-6989586621681157074"><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157074"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-392"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157073"><span class="annot"><span class="annottext">tup_names :: [Name]
</span><a href="#local-6989586621681157073"><span class="hs-identifier hs-var hs-var">tup_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157076"><span class="hs-identifier hs-var">rec_names</span></a></span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [Name] -&gt; [Name]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; [Name] -&gt; [Name]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157076"><span class="hs-identifier hs-var">rec_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157078"><span class="hs-identifier hs-var">later_names</span></a></span><span>
</span><span id="line-393"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157070"><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157070"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; TcType -&gt; TcM [TcType]
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTys"><span class="hs-identifier hs-var">newFlexiTyVarTys</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Arity
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Arity
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681157073"><span class="hs-identifier hs-var">tup_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-394"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157068"><span class="annot"><span class="annottext">tup_ids :: [TcTyVar]
</span><a href="#local-6989586621681157068"><span class="hs-identifier hs-var hs-var">tup_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; TcType -&gt; TcTyVar) -&gt; [Name] -&gt; [TcType] -&gt; [TcTyVar]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681157066"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681157066"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681157065"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157065"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; TcType -&gt; TcType -&gt; TcTyVar
Name -&gt; TcType -&gt; TcType -&gt; TcTyVar
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681157066"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157065"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681157073"><span class="hs-identifier hs-var">tup_names</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157070"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span><span> </span><span class="hs-comment">-- Many because it's a recursive definition</span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall a. [TcTyVar] -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Env.html#tcExtendIdEnv"><span class="hs-identifier hs-var">tcExtendIdEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
</span><a href="#local-6989586621681157068"><span class="hs-identifier hs-var">tup_ids</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
 -&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing))
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-396"></span><span>        </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157062"><span class="annot"><span class="annottext">[LStmt GhcTc (LHsCmd GhcTc)]
</span><a href="#local-6989586621681157062"><span class="hs-identifier hs-var">stmts'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157061"><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681157061"><span class="hs-identifier hs-var">tup_rets</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span>                </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; TcStmtChecker HsCmd TcType
-&gt; [CmdLStmt GhcRn]
-&gt; TcType
-&gt; (TcType -&gt; TcM [HsExpr GhcTc])
-&gt; TcM ([LStmt GhcTc (LHsCmd GhcTc)], [HsExpr GhcTc])
forall (body :: * -&gt; *) rho_type thing.
Outputable (body GhcRn) =&gt;
HsStmtContext GhcRn
-&gt; TcStmtChecker body rho_type
-&gt; [LStmt GhcRn (Located (body GhcRn))]
-&gt; rho_type
-&gt; (rho_type -&gt; TcM thing)
-&gt; TcM ([LStmt GhcTc (Located (body GhcTc))], thing)
</span><a href="GHC.Tc.Gen.Match.html#tcStmtsAndThen"><span class="hs-identifier hs-var">tcStmtsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><a href="#local-6989586621681157083"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdEnv -&gt; TcStmtChecker HsCmd TcType
</span><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157084"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmdLStmt GhcRn]
</span><a href="#local-6989586621681157080"><span class="hs-identifier hs-var">stmts</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157075"><span class="hs-identifier hs-var">res_ty</span></a></span><span>   </span><span class="annot"><span class="annottext">((TcType -&gt; TcM [HsExpr GhcTc])
 -&gt; TcM ([LStmt GhcTc (LHsCmd GhcTc)], [HsExpr GhcTc]))
-&gt; (TcType -&gt; TcM [HsExpr GhcTc])
-&gt; TcM ([LStmt GhcTc (LHsCmd GhcTc)], [HsExpr GhcTc])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681157060"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157060"><span class="hs-identifier hs-var">_res_ty'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-398"></span><span>                        </span><span class="hs-comment">-- ToDo: res_ty not really right</span><span>
</span><span id="line-399"></span><span>                   </span><span class="annot"><span class="annottext">(Name
 -&gt; ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (HsExpr GhcTc))
-&gt; [Name] -&gt; [ExpRhoType] -&gt; TcM [HsExpr GhcTc]
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; b -&gt; m c) -&gt; [a] -&gt; [b] -&gt; m [c]
</span><a href="../../base/src/Control.Monad.html#zipWithM"><span class="hs-identifier hs-var">zipWithM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; ExpRhoType -&gt; IOEnv (Env TcGblEnv TcLclEnv) (HsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckId"><span class="hs-identifier hs-var">tcCheckId</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681157073"><span class="hs-identifier hs-var">tup_names</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(TcType -&gt; ExpRhoType) -&gt; [TcType] -&gt; [ExpRhoType]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; ExpRhoType
</span><a href="GHC.Tc.Utils.TcType.html#mkCheckExpType"><span class="hs-identifier hs-var">mkCheckExpType</span></a></span><span> </span><span class="annot"><span class="annottext">[TcType]
</span><a href="#local-6989586621681157070"><span class="hs-identifier hs-var">tup_elt_tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157058"><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157058"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><a href="#local-6989586621681157074"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157075"><span class="hs-identifier hs-var">res_ty</span></a></span><span>
</span><span id="line-402"></span><span>                </span><span class="hs-comment">-- NB:  The rec_ids for the recursive things</span><span>
</span><span id="line-403"></span><span>                </span><span class="hs-comment">--      already scope over this part. This binding may shadow</span><span>
</span><span id="line-404"></span><span>                </span><span class="hs-comment">--      some of them with polymorphic things with the same Name</span><span>
</span><span id="line-405"></span><span>                </span><span class="hs-comment">--      (see note [RecStmt] in GHC.Hs.Expr)</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157057"><span class="annot"><span class="annottext">rec_ids :: [TcTyVar]
</span><a href="#local-6989586621681157057"><span class="hs-identifier hs-var hs-var">rec_ids</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [TcTyVar] -&gt; [TcTyVar]
forall b a. [b] -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#takeList"><span class="hs-identifier hs-var">takeList</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157076"><span class="hs-identifier hs-var">rec_names</span></a></span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
</span><a href="#local-6989586621681157068"><span class="hs-identifier hs-var">tup_ids</span></a></span><span>
</span><span id="line-408"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157055"><span class="annot"><span class="annottext">[TcTyVar]
</span><a href="#local-6989586621681157055"><span class="hs-identifier hs-var">later_ids</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; TcM [TcTyVar]
</span><a href="GHC.Tc.Utils.Env.html#tcLookupLocalIds"><span class="hs-identifier hs-var">tcLookupLocalIds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157078"><span class="hs-identifier hs-var">later_names</span></a></span><span>
</span><span id="line-409"></span><span>
</span><span id="line-410"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157053"><span class="annot"><span class="annottext">rec_rets :: [HsExpr GhcTc]
</span><a href="#local-6989586621681157053"><span class="hs-identifier hs-var hs-var">rec_rets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; [HsExpr GhcTc] -&gt; [HsExpr GhcTc]
forall b a. [b] -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#takeList"><span class="hs-identifier hs-var">takeList</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681157076"><span class="hs-identifier hs-var">rec_names</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681157061"><span class="hs-identifier hs-var">tup_rets</span></a></span><span>
</span><span id="line-411"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157052"><span class="annot"><span class="annottext">ret_table :: [(TcTyVar, HsExpr GhcTc)]
</span><a href="#local-6989586621681157052"><span class="hs-identifier hs-var hs-var">ret_table</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcTyVar] -&gt; [HsExpr GhcTc] -&gt; [(TcTyVar, HsExpr GhcTc)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
</span><a href="#local-6989586621681157068"><span class="hs-identifier hs-var">tup_ids</span></a></span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681157061"><span class="hs-identifier hs-var">tup_rets</span></a></span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681157051"><span class="annot"><span class="annottext">later_rets :: [HsExpr GhcTc]
</span><a href="#local-6989586621681157051"><span class="hs-identifier hs-var hs-var">later_rets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681157050"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681157049"><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157049"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
</span><a href="#local-6989586621681157055"><span class="hs-identifier hs-var">later_ids</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681157048"><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157048"><span class="hs-identifier hs-var">j</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681157050"><span class="annot"><span class="annottext">HsExpr GhcTc
</span><a href="#local-6989586621681157050"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(TcTyVar, HsExpr GhcTc)]
</span><a href="#local-6989586621681157052"><span class="hs-identifier hs-var">ret_table</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157049"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">TcTyVar -&gt; TcTyVar -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TcTyVar
</span><a href="#local-6989586621681157048"><span class="hs-identifier hs-var">j</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Stmt GhcTc (LHsCmd GhcTc), thing)
-&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StmtLR GhcTc GhcTc Any
forall bodyR. StmtLR GhcTc GhcTc bodyR
</span><a href="GHC.Hs.Utils.html#emptyRecStmtId"><span class="hs-identifier hs-var">emptyRecStmtId</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_stmts :: [LStmt GhcTc (LHsCmd GhcTc)]
</span><a href="GHC.Hs.Expr.html#recS_stmts"><span class="hs-identifier hs-var">recS_stmts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LStmt GhcTc (LHsCmd GhcTc)]
</span><a href="#local-6989586621681157062"><span class="hs-identifier hs-var">stmts'</span></a></span><span>
</span><span id="line-415"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_later_ids :: [IdP GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_later_ids"><span class="hs-identifier hs-var">recS_later_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
[IdP GhcTc]
</span><a href="#local-6989586621681157055"><span class="hs-identifier hs-var">later_ids</span></a></span><span>
</span><span id="line-416"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_ids :: [IdP GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_rec_ids"><span class="hs-identifier hs-var">recS_rec_ids</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcTyVar]
[IdP GhcTc]
</span><a href="#local-6989586621681157057"><span class="hs-identifier hs-var">rec_ids</span></a></span><span>
</span><span id="line-417"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ext :: XRecStmt GhcTc GhcTc (LHsCmd GhcTc)
</span><a href="GHC.Hs.Expr.html#recS_ext"><span class="hs-identifier hs-var">recS_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecStmtTc
</span><a href="GHC.Hs.Utils.html#unitRecStmtTc"><span class="hs-identifier hs-var">unitRecStmtTc</span></a></span><span>
</span><span id="line-418"></span><span>                                     </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recS_later_rets :: [HsExpr GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_later_rets"><span class="hs-identifier hs-var">recS_later_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681157051"><span class="hs-identifier hs-var">later_rets</span></a></span><span>
</span><span id="line-419"></span><span>                                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_rec_rets :: [HsExpr GhcTc]
</span><a href="GHC.Hs.Expr.html#recS_rec_rets"><span class="hs-identifier hs-var">recS_rec_rets</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[HsExpr GhcTc]
</span><a href="#local-6989586621681157053"><span class="hs-identifier hs-var">rec_rets</span></a></span><span>
</span><span id="line-420"></span><span>                                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recS_ret_ty :: TcType
</span><a href="GHC.Hs.Expr.html#recS_ret_ty"><span class="hs-identifier hs-var">recS_ret_ty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157075"><span class="hs-identifier hs-var">res_ty</span></a></span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">thing
</span><a href="#local-6989586621681157058"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>        </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tcArrDoStmt"><span class="hs-identifier hs-var">tcArrDoStmt</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681157041"><span class="annot"><span class="annottext">Stmt GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157041"><span class="hs-identifier hs-var">stmt</span></a></span></span><span> </span><span class="annot"><span class="annottext">TcType
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM thing
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcM (Stmt GhcTc (LHsCmd GhcTc), thing)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tcArrDoStmt: unexpected Stmt&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Stmt GhcRn (LHsCmd GhcRn) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Stmt GhcRn (LHsCmd GhcRn)
</span><a href="#local-6989586621681157041"><span class="hs-identifier hs-var">stmt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-425"></span><span>
</span><span id="line-426"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#tc_arr_rhs"><span class="hs-identifier hs-type">tc_arr_rhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#CmdEnv"><span class="hs-identifier hs-type">CmdEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsCmd"><span class="hs-identifier hs-type">LHsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html#TcType"><span class="hs-identifier hs-type">TcType</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span id="tc_arr_rhs"><span class="annot"><span class="annottext">tc_arr_rhs :: CmdEnv -&gt; LHsCmd GhcRn -&gt; TcM (LHsCmd GhcTc, TcType)
</span><a href="GHC.Tc.Gen.Arrow.html#tc_arr_rhs"><span class="hs-identifier hs-var hs-var">tc_arr_rhs</span></a></span></span><span> </span><span id="local-6989586621681157039"><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157039"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681157038"><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157038"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681157037"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157037"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcType -&gt; TcM TcType
</span><a href="GHC.Tc.Utils.TcMType.html#newFlexiTyVarTy"><span class="hs-identifier hs-var">newFlexiTyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-428"></span><span>                        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681157036"><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157036"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdEnv -&gt; LHsCmd GhcRn -&gt; (TcType, TcType) -&gt; TcM (LHsCmd GhcTc)
</span><a href="GHC.Tc.Gen.Arrow.html#tcCmd"><span class="hs-identifier hs-var">tcCmd</span></a></span><span> </span><span class="annot"><span class="annottext">CmdEnv
</span><a href="#local-6989586621681157039"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">LHsCmd GhcRn
</span><a href="#local-6989586621681157038"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#unitTy"><span class="hs-identifier hs-var">unitTy</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157037"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsCmd GhcTc, TcType) -&gt; TcM (LHsCmd GhcTc, TcType)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsCmd GhcTc
</span><a href="#local-6989586621681157036"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157037"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Helpers
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#mkPairTy"><span class="hs-identifier hs-type">mkPairTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-440"></span><span id="mkPairTy"><span class="annot"><span class="annottext">mkPairTy :: TcType -&gt; TcType -&gt; TcType
</span><a href="GHC.Tc.Gen.Arrow.html#mkPairTy"><span class="hs-identifier hs-var hs-var">mkPairTy</span></a></span></span><span> </span><span id="local-6989586621681157034"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157034"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621681157033"><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157033"><span class="hs-identifier hs-var">t2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [TcType] -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConApp"><span class="hs-identifier hs-var">mkTyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="GHC.Builtin.Types.html#pairTyCon"><span class="hs-identifier hs-var">pairTyCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157034"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">TcType
</span><a href="#local-6989586621681157033"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#arrowTyConKind"><span class="hs-identifier hs-type">arrowTyConKind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Kind"><span class="hs-identifier hs-type">Kind</span></a></span><span>          </span><span class="hs-comment">--  *-&gt;*-&gt;*</span><span>
</span><span id="line-443"></span><span id="arrowTyConKind"><span class="annot"><span class="annottext">arrowTyConKind :: TcType
</span><a href="GHC.Tc.Gen.Arrow.html#arrowTyConKind"><span class="hs-identifier hs-var hs-var">arrowTyConKind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TcType] -&gt; TcType -&gt; TcType
</span><a href="GHC.Core.TyCo.Rep.html#mkVisFunTysMany"><span class="hs-identifier hs-var">mkVisFunTysMany</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">TcType
</span><a href="GHC.Builtin.Types.html#liftedTypeKind"><span class="hs-identifier hs-var">liftedTypeKind</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Errors
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="annot"><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-type">cmdCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsCmd"><span class="hs-identifier hs-type">HsCmd</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-454"></span><span id="cmdCtxt"><span class="annot"><span class="annottext">cmdCtxt :: HsCmd GhcRn -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Arrow.html#cmdCtxt"><span class="hs-identifier hs-var hs-var">cmdCtxt</span></a></span></span><span> </span><span id="local-6989586621681157029"><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157029"><span class="hs-identifier hs-var">cmd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the command:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsCmd GhcRn
</span><a href="#local-6989586621681157029"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-455"></span></pre></body></html>